package com.wzapp.sitposture.common.error;

import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import java.lang.reflect.Method;

/**
 * 功能: 处理异步任务返回值为void的异常<br/>
 *
 * @author ql
 * @version 0.4
 * @create 2018-09-25 18:44
 **/
@Slf4j
public class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler {

    @Override
    public void handleUncaughtException(Throwable throwable, Method method, Object... obj) {

        log.error("EigAsyncException message - " + throwable.getMessage(),throwable);
        log.error("Method name - " + method.getName());
        for (Object param : obj) {
            log.error("Parameter value - " + param);
        }
    }
}
